package com.sky.mapper;

import com.sky.amnotaion.AutoFill;
import com.sky.dto.EmployeeDTO;
import com.sky.dto.PasswordEditDTO;
import com.sky.entity.Employee;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    @Select("select * from employee where username = #{username}")
    Employee getByUsername(String username);

    void addEmployee(Employee employee);

    List<Employee> pageSelectEmployee(@Param("name") String name);

    @AutoFill(OperationType.UPDATE)
    void updateEnableDisable(Employee build);

    Employee selectByIdEmployee(Integer id);

    void updateEmployee(EmployeeDTO employeeDTO);

    void updateEmployeePassword(PasswordEditDTO passwordEditDTO);

}
